package com.itheima.controller;


import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping
public class LogController {
    @Autowired
    private OperateLogService operateLogService;
    /**
     * 分页查询操作日志
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/log/page")
    public Result page(Integer page, Integer pageSize) {
        log.info("分页查询操作日志开始，参数：{}，{}", page, pageSize);
        PageResult pageResult = operateLogService.list(page,pageSize);
        return Result.success(pageResult);
    }
}
